﻿using System;
using UnityEngine;

// Token: 0x02000322 RID: 802
[AddComponentMenu("Rendering/SetRenderQueue")]
public class SetRenderQueue : MonoBehaviour
{
	// Token: 0x06001438 RID: 5176 RVA: 0x0008E11C File Offset: 0x0008C31C
	protected void Awake()
	{
		this.rend = base.GetComponent<Renderer>();
		this.Set();
	}

	// Token: 0x06001439 RID: 5177 RVA: 0x0008E130 File Offset: 0x0008C330
	private void OnValidate()
	{
		this.Set();
	}

	// Token: 0x0600143A RID: 5178 RVA: 0x0008E138 File Offset: 0x0008C338
	public void Set()
	{
		if (Application.isPlaying && this.rend != null)
		{
			int num = 0;
			while (num < this.rend.materials.Length && num < this.m_queues.Length)
			{
				this.rend.materials[num].renderQueue = this.m_queues[num];
				num++;
			}
		}
	}

	// Token: 0x0600143B RID: 5179 RVA: 0x0008E1A8 File Offset: 0x0008C3A8
	public void Set(int[] queues)
	{
		this.m_queues = new int[queues.Length];
		queues.CopyTo(this.m_queues, 0);
		if (Application.isPlaying && this.rend != null)
		{
			int num = 0;
			while (num < this.rend.materials.Length && num < this.m_queues.Length)
			{
				this.rend.materials[num].renderQueue = this.m_queues[num];
				num++;
			}
		}
	}

	// Token: 0x0600143C RID: 5180 RVA: 0x0008E234 File Offset: 0x0008C434
	public int[] Get()
	{
		return this.m_queues;
	}

	// Token: 0x040018E5 RID: 6373
	[SerializeField]
	protected int[] m_queues = new int[]
	{
		3000
	};

	// Token: 0x040018E6 RID: 6374
	private Renderer rend;
}
